/*Really Simple Reader - An RSS feed reader for Android*/
/*       Created by B. Gokulakrishnan - 080125J        */
/* 		 	 CS3200 - Programming Project			   */

package com.yan.deezer.activity;

import android.os.Bundle;

import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.yan.deezer.R;


/*
 *This class creates the ReallySimple reader Activity (which displays the main screen) and uses methods
 *to obtain and parse XML data from the given RSS feed.
 */

public class ArtistAlbumListActivity extends SherlockActivity {

	private ArtistAlbumListManager artistAlbumListManager;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		
        setTheme(R.style.Theme_Sherlock_Light_DarkActionBar); //Used for theme switching in samples
		super.onCreate(savedInstanceState);
		setContentView(R.layout.album_list_screen);
	    String artistID = (String)getIntent().getSerializableExtra("ARTIST_ID");
		initArtistListManager(artistID);

	}

	private void initArtistListManager(String artistID) 
	{
		artistAlbumListManager = new ArtistAlbumListManager(this, findViewById(R.id.album_listview),artistID);
	} 
	
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        //Used to put dark icons on light action bar

        menu.add("Rechercher un artist")
            .setIcon(R.drawable.ic_search)
            .setActionView(R.layout.collapsible_edittext)
            .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);

        return true;
    }

	

}